<template>
  <div class="right_container">
    <search-bar @query_click="handleQueryClick" @reset_click="handleResetClick" />
    <pagination-table ref="pagination_table" @click_edit="handleClickEdit" @click_item_detail="handleClickItemDetail"
      @click_create_reception="handleReceprion" />
  </div>
</template>

<script>
import SearchBar from './search-bar'
import PaginationTable from './pagination-table'

export default {
  name: 'ItemList',
  components: {
    SearchBar,
    PaginationTable,
  },
  data () {
    return {

    }
  },
  methods: {
    handleClick (tab, event) {
      console.log(tab, event);
    },
    /** 搜索栏组件事件处理----------------------------------------------------------- */
    /** 点击查询栏【查询】按钮 */
    handleQueryClick (queryParams) {
      this.$refs['pagination_table'].handleQuery(queryParams)
    },
    /** 点击查询栏【重置】按钮 */
    handleResetClick () {
      this.$refs['pagination_table'].handleQuery(null)
    },
    /** 操作栏组件的事件处理 -----------------------------------------------------------*/
    /** 点击操作栏【添加...】按钮 */
    handleClickCreateItem () {
      this.$refs['my_form'].openDialog(null)
    },
    // 表单组件事件处理
    /** 表单提交成功 */
    handleSubmitSuccess () {
      this.$refs['pagination_table'].refreshList()
    },
    /** 页码表格组件事件处理 -----------------------------------------------------------*/
    /** 点击列表【编辑】按钮 */
    handleClickEdit (id) {
      this.$refs['my_form'].openDialog(id)
    },
    /** 点击列表【详情】按钮 */
    handleClickItemDetail (id) {
      this.$refs['item_detail_drawer'].handleOpenDrawer(id)
    },
    // 传递子级id给父级tab标签
    handleReceprion (id) {
      this.$emit('click_create_receptiondate', id)
    },

  }
}
</script>
<style lang="scss" scoped>
.right_container {
  padding: 0;
}
</style>
